package com.smartlbs.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.smartlbs.baseframe.web.ResponseInfo;
import com.smartlbs.entity.Bigchamp;
import com.smartlbs.service.IBetInfoService;
import com.smartlbs.service.IGameInfoService;
import com.smartlbs.vo.GameInfoVo;

@Controller
@RequestMapping("game/info")
public class GameInfoController {
	@Autowired
	private IGameInfoService gameInfoService;
	@Autowired
	private IBetInfoService betInfoService;
	/**
	 * @param request
	 * @return 大赛事数据
	 */
	@RequestMapping("getbigchamp")
	@ResponseBody
	public ResponseInfo getBigchamp(HttpServletRequest request) {
		int result = 0;
		String message = "";
		Object data = null;
		
		try {
			 List<Bigchamp> findBigchamp = gameInfoService.findBigchampands();
			result = 1;
			message = "数据获取成功";
			data = findBigchamp;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			message = "发生异常";

			e.printStackTrace();
		}
		ResponseInfo responseInfo = new ResponseInfo();
		responseInfo.setData(data);
		responseInfo.setResult(result);
		responseInfo.setMessage(message);
		return responseInfo;
	}
	/**
	 * @param request
	 * @param gamename 大赛事名称
	 * @return 赛事列表
	 */
	@RequestMapping("findbybichampname")
	@ResponseBody
	public ResponseInfo findBybichampname(HttpServletRequest request,String outid){
		int result = 0;
		String message = "";
		Object data = null;
		try {
			 List<GameInfoVo> findBybichampname = gameInfoService.findByoutIdands(outid);
			result = 1;
			message = "获取成功";
			data=findBybichampname;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		ResponseInfo responseInfo = new ResponseInfo();
		responseInfo.setData(data);
		responseInfo.setResult(result);
		responseInfo.setMessage(message);
		return responseInfo;
	}
}
